<!DOCTYPE html>
<html lang="zh">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <!--<link rel="icon" href="<%= BASE_URL %>favicon.ico">-->
    <link rel="stylesheet" href="./css/reset.css">
    <link rel="stylesheet" href="css/zTreeStyle.css">
    <!--<link rel="stylesheet" href="./css/base.css">-->
    <title>hloa</title>
    <meta name="renderer" content="webkit">
    <meta name="HandheldFriendly" content="true">
    <meta name="screen-orientation" content="portrait">
    <meta name="x5-orientation" content="portrait">
    <meta http-equiv="Expires" content="-1">
    <meta name="x5-page-mode" content="app">
    <meta name='apple-mobile-web-app-capable' content='yes' />
    <meta name='full-screen' content='true' />
    <meta name='x5-fullscreen' content='true' />
    <meta name='360-fullscreen' content='true' />

    <script src="js/jquery-1.4.4.min.js"></script>


  </head>
  <body>
    <noscript>
      <strong>We're sorry but hloa doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
    </noscript>
    <div id="app"></div>
    <!-- built files will be auto injected -->
  </body>
  <!--<script>-->
    <!--var slider = {-->
      <!--//判断设备是否支持touch事件-->
      <!--touch: ('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch,-->
      <!--slider: document.getElementById('app'),-->
      <!--//事件-->
      <!--events: {-->
        <!--index: 0, //显示元素的索引-->
        <!--slider: this.slider, //this为slider对象-->
        <!--icons: null,-->
        <!--icon: null,-->
        <!--handleEvent: function (event) {-->
          <!--var self = this; //this指events对象-->
          <!--if (event.type == 'touchstart') {-->
            <!--self.start(event);-->
          <!--} else if (event.type == 'touchmove') {-->
            <!--self.move(event);-->
          <!--} else if (event.type == 'touchend') {-->
            <!--self.end(event);-->
          <!--}-->
        <!--},-->
        <!--//滑动开始-->
        <!--start: function (event) {-->
          <!--event.stopPropagation();-->

          <!--var touch = event.targetTouches[0]; //touches数组对象获得屏幕上所有的touch，取第一个touch-->
          <!--startPos = { x: touch.pageX, y: touch.pageY, time: +new Date }; //取第一个touch的坐标值-->
          <!--isScrolling = 0; //这个参数判断是垂直滚动还是水平滚动-->
          <!--var _silder = document.getElementById('app');-->
          <!--_silder.addEventListener('touchmove', this, false);-->
          <!--_silder.addEventListener('touchend', this, false);-->
          <!--//this.slider.addEventListener('touchmove', this, false);-->
          <!--//this.slider.addEventListener('touchend', this, false);-->
        <!--},-->
        <!--//移动-->
        <!--move: function (event) {-->
          <!--event.stopPropagation(); //阻止触摸事件的默认行为，即阻止滚屏-->
          <!--//当屏幕有多个touch或者页面被缩放过，就不执行move操作-->
          <!--if (event.targetTouches.length > 1 || event.scale && event.scale !== 1) return;-->
          <!--var touch = event.targetTouches[0];-->
          <!--endPos = { x: touch.pageX - startPos.x, y: touch.pageY - startPos.y };-->
          <!--isScrolling = Math.abs(endPos.x) < Math.abs(endPos.y) ? 1 : 0; //isScrolling为1时，表示纵向滑动，0为横向滑动-->
          <!--if (isScrolling === 0) {-->

            <!--//this.slider.className = 'cnt';-->
            <!--//this.slider.style.left = -this.index * 600 + endPos.x + 'px';-->
            <!--//alert('yes');-->
          <!--}-->
        <!--},-->
        <!--//滑动释放-->
        <!--end: function (event) {-->
          <!--var duration = +new Date - startPos.time; //滑动的持续时间-->
          <!--if (isScrolling === 0) { //当为水平滚动时-->
            <!--event.stopPropagation();-->
          <!--} else {-->

          <!--}-->
          <!--//解绑事件-->
          <!--var _silder = document.getElementById('app');-->
          <!--_silder.removeEventListener('touchmove', this, false);-->
          <!--_silder.removeEventListener('touchend', this, false);-->
          <!--//this.slider.removeEventListener('touchmove', this, false);-->
          <!--//this.slider.removeEventListener('touchend', this, false);-->
        <!--}-->
      <!--},-->
      <!--//初始化-->
      <!--init: function () {-->
        <!--var self = this; //this指slider对象-->
        <!--if (!!self.touch) self.slider.addEventListener('touchstart', self.events, false); //addEventListener第二个参数可以传一个对象，会调用该对象的handleEvent属性-->
      <!--}-->
    <!--};-->
    <!--window.onload=function(){-->
      <!--slider.init();-->
    <!--}-->

  <!--</script>-->

  <!--<script>-->
    <!--var overscroll = function(el) {-->
      <!--el.addEventListener('touchstart', function() {-->
        <!--var top = el.scrollTop-->
          <!--, totalScroll = el.scrollHeight-->
          <!--, currentScroll = top + el.offsetHeight-->
        <!--//If we're at the top or the bottom of the containers-->
        <!--//scroll, push up or down one pixel.-->
        <!--//-->
        <!--//this prevents the scroll from "passing through" to-->
        <!--//the body.-->
        <!--if(top === 0) {-->
          <!--el.scrollTop = 1-->
        <!--} else if(currentScroll === totalScroll) {-->
          <!--el.scrollTop = top - 1-->
        <!--}-->
      <!--})-->
      <!--el.addEventListener('touchmove', function(evt) {-->
        <!--//if the content is actually scrollable, i.e. the content is long enough-->
        <!--//that scrolling can occur-->
        <!--if(el.offsetHeight < el.scrollHeight)-->
          <!--evt._isScroller = true-->
      <!--})-->
    <!--}-->
    <!--overscroll(document.querySelector('#app'));-->
    <!--document.body.addEventListener('touchmove', function(evt) {-->
      <!--//In this case, the default behavior is scrolling the body, which-->
      <!--//would result in an overflow.  Since we don't want that, we preventDefault.-->
      <!--if(!evt._isScroller) {-->
        <!--evt.preventDefault()-->
      <!--}-->
    <!--})-->

  <!--</script>-->

  <script>
    var scrollList=['ul.ztree','.el-aside','.el-dialog__wrapper','.el-table__body-wrapper' ,'.absolute-box'];


    function isScroll(e) {
      for (var i=0;i<scrollList.length;i++){
        var b=(e === document.querySelector(scrollList[i]))? false : document.querySelector(scrollList[i]).contains(e);
        if (b==true){
          //可滚动div内
          $(scrollList[i]).scrollTop()==0?false:true
         // return b
        }
      }
      return false
    }


    //手指接触屏幕
    var startx , starty ;
    document.addEventListener("touchstart", function(e) {
      startx = e.touches[0].pageX;
      starty = e.touches[0].pageY;
    }, false);
    // document.body.addEventListener('touchmove',function(e){
    //   if (! isScroll(e.target)){}
    // },{ passive:false })

    document.addEventListener("touchmove", function(e) {
      var box=isInScroll(e.target);
      if (box==false){
        e.preventDefault();
        return
      }
      var movex, movey;
      movex = e.changedTouches[0].pageX;
      movey = e.changedTouches[0].pageY;
      var direction = getDirection(startx, starty, movex, movey);
      switch (direction) {
        case 0:
          //alert("未滑动！");
          break;
        case 1:
          //alert("向上！")
         var paddingBottom = parseInt( $(box).css('padding-bottom') ),paddingTop = parseInt( $(box).css('padding-top') );
         $(box).scrollTop()>=$(box)[0].scrollHeight-$(box).height()-paddingBottom-paddingTop?e.preventDefault():"";
          break;
        case 2:
          $(box).scrollTop()==0?e.preventDefault():"";
          //alert("向下！")
          break;
        case 3:
          var paddingLeft = parseInt( $(box).css('padding-left') ),paddingRight = parseInt( $(box).css('padding-right') );
          $(box).scrollLeft()>=$(box)[0].scrollWidth-$(box).width()-paddingLeft-paddingRight?e.preventDefault():"";
          //alert("向左！")
          break;
        case 4:
          $(box).scrollLeft()==0?e.preventDefault():"";
          //alert("向右！")
          break;
        default:
      }
    },{ passive:false });
    
    //获得角度
    function getAngle(angx, angy) {
      return Math.atan2(angy, angx) * 180 / Math.PI;
    };

    //根据起点终点返回方向 1向上 2向下 3向左 4向右 0未滑动
    function getDirection(startx, starty, endx, endy) {
      var angx = endx - startx;
      var angy = endy - starty;
      var result = 0;

      //如果滑动距离太短
      if (Math.abs(angx) < 2 && Math.abs(angy) < 2) {
        return result;
      }

      var angle = getAngle(angx, angy);
      if (angle >= -135 && angle <= -45) {
        result = 1;
      } else if (angle > 45 && angle < 135) {
        result = 2;
      } else if ((angle >= 135 && angle <= 180) || (angle >= -180 && angle < -135)) {
        result = 3;
      } else if (angle >= -45 && angle <= 45) {
        result = 4;
      }

      return result;
    }

    //判断是否在可滑动区域内
    function isInScroll(tar) {
      for (var i=0;i<scrollList.length;i++){
        if(document.querySelector(scrollList[i])==null){
          continue
        }
        var b=(tar === document.querySelector(scrollList[i]))? true : document.querySelector(scrollList[i]).contains(tar);
        if (b==true){
           return scrollList[i]
        }
      }
      return false
    }

  </script>

  <!--<script>-->
    <!--var startx, starty;-->
    <!--//获得角度-->
    <!--function getAngle(angx, angy) {-->
      <!--return Math.atan2(angy, angx) * 180 / Math.PI;-->
    <!--};-->

    <!--//根据起点终点返回方向 1向上 2向下 3向左 4向右 0未滑动-->
    <!--function getDirection(startx, starty, endx, endy) {-->
      <!--var angx = endx - startx;-->
      <!--var angy = endy - starty;-->
      <!--var result = 0;-->

      <!--//如果滑动距离太短-->
      <!--if (Math.abs(angx) < 2 && Math.abs(angy) < 2) {-->
        <!--return result;-->
      <!--}-->

      <!--var angle = getAngle(angx, angy);-->
      <!--if (angle >= -135 && angle <= -45) {-->
        <!--result = 1;-->
      <!--} else if (angle > 45 && angle < 135) {-->
        <!--result = 2;-->
      <!--} else if ((angle >= 135 && angle <= 180) || (angle >= -180 && angle < -135)) {-->
        <!--result = 3;-->
      <!--} else if (angle >= -45 && angle <= 45) {-->
        <!--result = 4;-->
      <!--}-->

      <!--return result;-->
    <!--}-->
    <!--//手指接触屏幕-->
    <!--document.addEventListener("touchstart", function(e) {-->
      <!--startx = e.touches[0].pageX;-->
      <!--starty = e.touches[0].pageY;-->
    <!--}, false);-->
    <!--//手指离开屏幕-->
    <!--document.addEventListener("touchend", function(e) {-->
      <!--var endx, endy;-->
      <!--endx = e.changedTouches[0].pageX;-->
      <!--endy = e.changedTouches[0].pageY;-->
      <!--var direction = getDirection(startx, starty, endx, endy);-->
      <!--switch (direction) {-->
        <!--case 0:-->
          <!--alert("未滑动！");-->
          <!--break;-->
        <!--case 1:-->
          <!--alert("向上！")-->
          <!--break;-->
        <!--case 2:-->
          <!--alert("向下！")-->
          <!--break;-->
        <!--case 3:-->
          <!--alert("向左！")-->
          <!--break;-->
        <!--case 4:-->
          <!--alert("向右！")-->
          <!--break;-->
        <!--default:-->
      <!--}-->
    <!--}, false);-->
  <!--</script>-->
</html>
